package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TMembershipConditionsMapper;
import com.ruoyi.system.domain.TMembershipConditions;
import com.ruoyi.system.service.ITMembershipConditionsService;

/**
 * 入会条件信息，存储会员入会条件的各个版本及其状态Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-25
 */
@Service
public class TMembershipConditionsServiceImpl implements ITMembershipConditionsService 
{
    @Autowired
    private TMembershipConditionsMapper tMembershipConditionsMapper;

    /**
     * 查询入会条件信息，存储会员入会条件的各个版本及其状态
     * 
     * @param conditionId 入会条件信息，存储会员入会条件的各个版本及其状态主键
     * @return 入会条件信息，存储会员入会条件的各个版本及其状态
     */
    @Override
    public TMembershipConditions selectTMembershipConditionsByConditionId(Long conditionId)
    {
        return tMembershipConditionsMapper.selectTMembershipConditionsByConditionId(conditionId);
    }

    /**
     * 查询入会条件信息，存储会员入会条件的各个版本及其状态列表
     * 
     * @param tMembershipConditions 入会条件信息，存储会员入会条件的各个版本及其状态
     * @return 入会条件信息，存储会员入会条件的各个版本及其状态
     */
    @Override
    public List<TMembershipConditions> selectTMembershipConditionsList(TMembershipConditions tMembershipConditions)
    {
        return tMembershipConditionsMapper.selectTMembershipConditionsList(tMembershipConditions);
    }

    /**
     * 新增入会条件信息，存储会员入会条件的各个版本及其状态
     * 
     * @param tMembershipConditions 入会条件信息，存储会员入会条件的各个版本及其状态
     * @return 结果
     */
    @Override
    public int insertTMembershipConditions(TMembershipConditions tMembershipConditions)
    {
        return tMembershipConditionsMapper.insertTMembershipConditions(tMembershipConditions);
    }

    /**
     * 修改入会条件信息，存储会员入会条件的各个版本及其状态
     * 
     * @param tMembershipConditions 入会条件信息，存储会员入会条件的各个版本及其状态
     * @return 结果
     */
    @Override
    public int updateTMembershipConditions(TMembershipConditions tMembershipConditions)
    {
        return tMembershipConditionsMapper.updateTMembershipConditions(tMembershipConditions);
    }

    /**
     * 批量删除入会条件信息，存储会员入会条件的各个版本及其状态
     * 
     * @param conditionIds 需要删除的入会条件信息，存储会员入会条件的各个版本及其状态主键
     * @return 结果
     */
    @Override
    public int deleteTMembershipConditionsByConditionIds(Long[] conditionIds)
    {
        return tMembershipConditionsMapper.deleteTMembershipConditionsByConditionIds(conditionIds);
    }

    /**
     * 删除入会条件信息，存储会员入会条件的各个版本及其状态信息
     * 
     * @param conditionId 入会条件信息，存储会员入会条件的各个版本及其状态主键
     * @return 结果
     */
    @Override
    public int deleteTMembershipConditionsByConditionId(Long conditionId)
    {
        return tMembershipConditionsMapper.deleteTMembershipConditionsByConditionId(conditionId);
    }

    @Override
    public TMembershipConditions selectFirstActiveCondition() {
        return tMembershipConditionsMapper.selectFirstActiveCondition();
    }
}
